//
//  UIButton+Helper.m
//  Live
//
//  Created by 唐开福 on 2017/5/23.
//  Copyright © 2017年 LaKa. All rights reserved.
//

#import "UIButton+Convenient.h"

@implementation UIControl (Convenient)

- (void)lk_addTarget:(id)target action:(SEL)action
{
    [self addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
}

@end

@implementation UIButton (Convenient)

- (void)lk_setTitle:(NSString *)title
{
    [self setTitle:title forState:UIControlStateNormal];
}

- (void)lk_setAttributeTitle:(NSAttributedString *)title
{
    [self setAttributedTitle:title forState:UIControlStateNormal];
}

- (void)lk_setFontSize:(CGFloat)size
{
    self.titleLabel.font = [UIFont systemFontOfSize:size];
}

- (void)lk_setFont:(UIFont *)font
{
    self.titleLabel.font = font;
}

- (void)lk_setTextColor:(UIColor *)color
{
    [self setTitleColor:color forState:UIControlStateNormal];
}

- (void)lk_setImage:(UIImage *)image
{
    [self setImage:image forState:UIControlStateNormal];
}

- (void)lk_setBackgroundImage:(UIImage *)image
{
    [self setBackgroundImage:image forState:UIControlStateNormal];
}

- (void)lk_setImageWithName:(NSString *)imageName
{
    [self setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
}

- (void)lk_setBackgroundImageWithName:(NSString *)imageName
{
    [self setBackgroundImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
}

- (void)lk_addTarget:(id)target action:(SEL)action
{
    [self addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
}
@end
